﻿<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>文件管理系统</title>

    <link href="/static/other/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/other/css/font-awesome.css" rel="stylesheet">

    <link href="/static/other/css/animate.css" rel="stylesheet">
    <link href="/static/other/css/style.css" rel="stylesheet">

</head>

<body>

    <div id="wrapper">

    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="sidebar-collapse">
            <ul class="nav metismenu" id="side-menu">
                <li class="nav-header">
                    <div class="dropdown profile-element">
                        <img alt="image" class="rounded-circle" src="/static/other/picture/profile_small.jpg"/>
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                            <span class="block m-t-xs font-bold">{{ user_name }}</span>
                            <span class="text-muted text-xs block">普通用户 <b class="caret"></b></span>
                        </a>
                        <ul class="dropdown-menu animated fadeInRight m-t-xs">
                            <li><a class="dropdown-item" href="profile.html">个人信息</a></li>
                            <li><a class="dropdown-item" href="contacts.html">好友</a></li>
                            <li><a class="dropdown-item" href="mailbox.html">信箱</a></li>
                            <li class="dropdown-divider"></li>
                            <li><a class="/user/logout/" href="login.html">登出</a></li>
                        </ul>
                    </div>
                    <div class="logo-element">
                        IN+
                    </div>
                </li>
                <li>
                    <a href="index.html"><i class="fa fa-th-large"></i> <span class="nav-label">Dashboards</span> <span class="fa arrow"></span></a>
                    <ul class="nav nav-second-level collapse">
                        <li><a href="/user/myfile/">主页</a></li>

                    </ul>
                </li>

            </ul>

        </div>
    </nav>

        <div id="page-wrapper" class="gray-bg">
        <div class="row border-bottom">
        <nav class="navbar navbar-static-top  " role="navigation" style="margin-bottom: 0">
        <div class="navbar-header">
            <a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
            <form role="search" class="navbar-form-custom" action="search_results.html">
                <div class="form-group">
                    <input type="text" placeholder="请输入搜索内容" class="form-control" name="top-search" id="top-search">
                </div>
            </form>
        </div>
            <ul class="nav navbar-top-links navbar-right">
                <li>
                    <span class="m-r-sm text-muted welcome-message">文件管理系统</span>
                </li>


                <li>
                    <a href="/user/logout/">
                        <i class="fa fa-sign-out"></i> 注销
                    </a>
                </li>
            </ul>

        </nav>
        </div>
            <div class="row wrapper border-bottom white-bg page-heading">
                <div class="col-lg-9">
                    <h2>文件管理器</h2>
                </div>
            </div>
        <div class="wrapper wrapper-content">
            <div class="row">
                <div class="col-lg-3">
                    <div class="ibox ">
                        <div class="ibox-content">
                            <div class="file-manager">
                                <form method="post" enctype="multipart/form-data" action="/user/myfile/">
                                {% csrf_token %}
                                    <h4>选择项目</h4>
                                    <select size="5" style="width: 100%;color: inherit" name="project_id" required>
                                        {% for i in user_project %}
                                        <option value="{{ i.user_project__project_id }}" style="font-size: 10px;margin-top: 3px">{{ i.user_project__project_alias }}</option>
                                        {% endfor %}
                                    </select>
                                    <div class="hr-line-dashed"></div>
                                    <h4>文件MD5值</h4>
                                    <input type="text" name="file_md5"  style="width: 100%" value="0">
                                    <span>该md5值需要本地生成,主要为验证下载包是否正确</span>
                                    <div class="hr-line-dashed"></div>
                                    <h4>选择文件</h4>
                                    <input type="file" name="userfile" required>
                                    <div class="hr-line-dashed"></div>
                                    <button class="btn btn-primary btn-block">上传文件</button>



                                </form>
                                <div class="hr-line-dashed"></div>
                                    <h4>选择项目展示</h4>
                                    <ul class="folder-list" style="padding: 0" >
                                        {% for p in user_project %}
                                        <li><a href="/user/myfile/?user={{ user_name }}&project_id={{ p.user_project__project_id }}"><i class="fa fa-folder"></i> {{ p.user_project__project_alias }}</a></li>
                                        {% endfor %}
                                    </ul>

                                <div class="clearfix"></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-9 animated fadeInRight">

                    <div class="ibox ">
                    <div class="ibox-title">
                        <h5>文件列表</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                                <i class="fa fa-wrench"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">

                        <table class="table">
                            <thead>
                            <tr>
                                <th>#</th>
                                <th>文件下载地址</th>
                                <th>文件MD5值</th>
                                <th>文件归属项目</th>
                                <th>文件更新者</th>
                                <th>文件更新日期</th>
                                <th>刷新cdn结果</th>
                                <th>刷新时间</th>
                                <th>刷新资源</th>
                                <th>管理</th>

                            </tr>
                            </thead>
                            <tbody>
                            {% for filelist in user_file_list %}
                            <tr>
                                <td>{{ filelist.file_id }}</td>
                                <td><a href="{{ filelist.web_path }}{{ filelist.file_path }}">{{ filelist.web_path }}{{ filelist.file_path }}</a> </td>
                                <td>{{ filelist.file_md5 }}</td>
                                <td>{{ filelist.file_project__project_alias }}</td>
                                <td>{{ filelist.file_user__user_alias }}</td>
                                <td>{{ filelist.file_ctime }}</td>
                                {% if filelist.file_cdn_status == "0" %}
                                <td style="color: green">刷新成功</td>
                                {% elif filelist.file_cdn_status == "888" %}
                                <td style="color: gray">未执行CDN刷新</td>
                                {% else %}
                                 <td style="color: red">刷新失败</td>
                                {% endif %}
                                <td>{{ filelist.file_cdn_time }}</td>
                                <td><a href="/cdn/refresh/?apk_url={{ filelist.web_path }}{{ filelist.file_path }}">刷新</a> </td>
                                {% if user_del_file == "1" %}
                                <td><a href="/user/delmyfile/?file_id={{ filelist.file_id }}">删除</a> </td>
                                {% else %}
                                    <td style="color: gray">删除 </td>
                                {% endif %}
                            </tr>
                            {% endfor %}
                            </tbody>
                        </table>

                    </div>
                </div>
                    </div>
                </div>
                </div>
        <div class="footer">
            <div class="float-right">
                 <strong>2.9.2 inspinia</strong>
            </div>
            <div>
                <strong>Copyright</strong> inspinia 2.9.2 &copy; 2014-2018
            </div>
        </div>

        </div>
            </div>


    <!-- Mainly scripts -->
    <script src="/static/other/js/jquery-3.1.1.min.js"></script>
    <script src="/static/other/js/popper.min.js"></script>
    <script src="/static/other/js/bootstrap.js"></script>
    <script src="/static/other/js/jquery.metismenu.js"></script>
    <script src="/static/other/js/jquery.slimscroll.min.js"></script>

    <!-- Custom and plugin javascript -->
    <script src="/static/other/js/inspinia.js"></script>
    <script src="/static/other/js/pace.min.js"></script>

</body>

</html>
